import { data } from '../uni_modules/uview-ui/libs/mixin/mixin'
import request from '@/utils/request'

// 订单列表
export function orderList(data) {
	return request({
		'url': '/front/order/order/pageByUser',
		'method': 'get',
		'data': data
	})
}

// 订单详情
export function getInfoByUser(orderId) {
	return request({
		'url': `/front/order/order/getInfoByUser/${orderId}`,
		'method': 'get',
	})
}

// 未支付订单调起支付
export function orderPay(data) {
	return request({
		'url': `/front/order/order/orderPay`,
		'method': 'post',
		data:data
	})
}
// c端用户取消订单
export function cancelledOrder(orderId) {
	return request({
		'url': `/front/order/order/cancelledOrder/${orderId}`,
		'method': 'get',
	})
}

// c端用户删除订单
export function deletedOrder(orderId) {
	return request({
		'url': `/front/order/order/deletedOrder/${orderId}`,
		'method': 'delete',
	})
}

// 校验订单是否能取消预订
export function checkCancelReservation(orderId) {
	return request({
		'url': `/front/order/order/checkCancelReservation/${orderId}`,
		'method': 'get',
	})
}
// 预订订单统计退款金额
export function computeRefund(orderId) {
	return request({
		'url': `/front/order/order/reservation/computeRefund/${orderId}`,
		'method': 'post',
	})
}

// 取消预订订单
export function cancelReservation(data) {
	return request({
		'url': `/front/order/order/cancelReservation`,
		'method': 'post',
		data:data
	})
}
// 订单统计
export function countOrderState(data) {
	return request({
		'url': `/front/order/order/countOrderState`,
		'method': 'get',
	})
}

// 根据登录用户查询退款订单列表
export function refundOrderList(data) {
	return request({
		'url': '/front/order/order/refund/pageByUser',
		'method': 'get',
		'data': data
	})
}

// 订单详情
export function getRefundInfoByUser(orderId) {
	return request({
		'url': `/front/order/order/refund/getInfoByUser/${orderId}`,
		'method': 'get',
	})
}

// 退房订单缴费调起支付
export function supplementaryPayment(data) {
	return request({
		'url': `/front/order/order/supplementaryPayment`,
		'method': 'post',
		data:data
	})
}

